CREATE FULLTEXT CATALOG [VacancyCatalog]

SELECT * FROM [sys].[fulltext_catalogs]


CREATE FULLTEXT INDEX ON [Vacancy]
( [Title], [Description] )
KEY INDEX PK__Vacancy__3214EC2720C1E124
ON VacancyCatalog
WITH CHANGE_TRACKING AUTO

SELECT * FROM [sys].[fulltext_indexes]





create FUNCTION VacancySearchFunction
(
 -- Add the parameters for the function here
	@name varchar(30) = 'Unknown' 
)
RETURNS @tmp TABLE 
(
	[Id] int,
	[Title] varchar(35)
)
AS
BEGIN
	set @name = '"' + @name + '"';
	insert @tmp
	SELECT [ID],[Title] FROM [Vacancy]
	WHERE contains(*,@name)
	RETURN 
END
go

create procedure VacancySearchProcedure
	@search_string varchar(35)
as 
begin
	select *
	from ResumeSearchFunction(@search_string)
end